package com.qingcloud.fexecutor.base.utils;

import cn.hutool.core.util.HexUtil;
import lombok.extern.slf4j.Slf4j;

import java.nio.charset.Charset;

@Slf4j
public class AesUtil {
    private AesUtil() {
    }

    /**
     * 加密成hex
     */
    public static String encryptHex(byte[] data) {
        return HexUtil.encodeHexStr(data);
    }

    /**
     * 解密hex字符串
     */
    public static String decryptHex(String hex, Charset charset) {
        return HexUtil.decodeHexStr(hex, charset);
    }

}
